<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        window.number = 2;  // 8
        var obj = {
            number: 3,
            db1: (function () {
                console.log(this);
                this.number *= 4;  // 调用完window.number=8
                return function () {
                    console.log(this);
                    this.number *= 5;
                }
            })()
        }
        var db1 = obj.db1;
        db1(); // 调用完window.number=40
        obj.db1();  // 调用完obj.number=15
        console.log(obj.number); // 15
        console.log(window.number); // 40
    </script>
</body>

</html>